/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import radiostation_POJO.Artist;
import radiostation_POJO.Musicgenre;
import javax.persistence.EntityManager;
import java.util.ArrayList;
import javax.swing.JList;
import javax.swing.JOptionPane;
import radiostation.AppControl;
import java.util.Date;
import javax.sql.*;
/**
 *
 * @author ΛΕΝΑ
 */
public class R3_Artist_Management extends javax.swing.JFrame {
    Connection conn = null;
    ResultSet rs = null;
    PreparedStatement pst = null;
    private String m;
    Artist art;
    
    private R2_ArtistList_View creator;
  
    private EntityManager em;
    private int cComp;
    Musicgenre MG;
    
    
    
    /**
     * Creates new form R3_Artist_Management
     */
    public R3_Artist_Management() {
       initComponents();
       
}
    
    public R3_Artist_Management(R2_ArtistList_View inJFrame) {
        initComponents();
        this.creator=inJFrame;
        genreComboBox.setSelectedItem(null);
        sexComboBox.setSelectedItem(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        RadioStationPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("RadioStationPU").createEntityManager();
        musicgenreQuery = java.beans.Beans.isDesignTime() ? null : RadioStationPUEntityManager.createQuery("SELECT m.genreName FROM Musicgenre m");
        musicgenreList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : musicgenreQuery.getResultList();
        jLabel1 = new javax.swing.JLabel();
        btnCancel = new javax.swing.JButton();
        jButSave = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        sexComboBox = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jTextArtistLastName = new javax.swing.JTextField();
        jTextArtistName = new javax.swing.JTextField();
        jTextArtisticName = new javax.swing.JTextField();
        jTextBirthPlace = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        genreComboBox = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jTextArtistId = new javax.swing.JTextField();
        ReleaseDt = new org.jdesktop.swingx.JXDatePicker();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Διαχείριση Καλλιτεχνών");

        btnCancel.setText("Ακύρωση");
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        jButSave.setText("Αποθήκευση");
        jButSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButSaveActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        sexComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female" }));
        sexComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sexComboBoxActionPerformed(evt);
            }
        });

        jLabel2.setText("Επώνυμο");

        jLabel3.setText("Φύλο");

        jLabel4.setText("Είδος μουσικής");

        jLabel5.setText("Ημερομηνία γέννησης");

        jLabel6.setText("Τόπος γέννησης");

        jLabel8.setText("Όνομα");

        jTextArtistLastName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextArtistLastNameActionPerformed(evt);
            }
        });

        jTextArtistName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextArtistNameActionPerformed(evt);
            }
        });

        jTextArtisticName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextArtisticNameActionPerformed(evt);
            }
        });

        jTextBirthPlace.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextBirthPlaceActionPerformed(evt);
            }
        });

        jLabel7.setText("Καλλιτεχνικό όνομα");

        org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, musicgenreList, genreComboBox);
        bindingGroup.addBinding(jComboBoxBinding);

        genreComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                genreComboBoxActionPerformed(evt);
            }
        });

        jLabel9.setText("Id Καλλιτέχνη");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(jTextArtistLastName, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
                                                .addGap(93, 93, 93)
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel3)
                                                    .addComponent(jLabel4)))
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                .addGap(0, 0, Short.MAX_VALUE)
                                                .addComponent(jLabel6)))
                                        .addGap(34, 34, 34))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jTextArtisticName, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(86, 86, 86)
                                        .addComponent(jLabel5)))))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(39, 39, 39)
                                .addComponent(sexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(genreComboBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextBirthPlace, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(85, 85, 85)
                                .addComponent(jTextArtistId, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel2)
                            .addComponent(jLabel8)
                            .addComponent(jTextArtistName, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(ReleaseDt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(sexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addGap(24, 24, 24)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(genreComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextArtistLastName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jTextArtistId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextArtistName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextBirthPlace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(ReleaseDt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(102, 102, 102))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jTextArtisticName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 423, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButSave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCancel)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addGap(30, 30, 30)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButSave)
                    .addComponent(btnCancel))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        // TODO add your handling code here:
        dispose(); 
    }//GEN-LAST:event_btnCancelActionPerformed

    private void jButSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButSaveActionPerformed
     if( creator.createMode&&!creator.deleteMode&&!creator.editMode){
         cComp=checkComponents();
       if(cComp==0){
           JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται Id καλλιτέχνη","Σφάλμα",1);
       }  else if(cComp==1){
        JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται επώνυμο καλλιτέχνη","Σφάλμα",1);
       }  else if(cComp==2){
           JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται όνομα καλλιτέχνη","Σφάλμα",1);
       }  else if(cComp==3){ 
           JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται καλλιτεχνικόόνομα καλλιτέχνη","Σφάλμα",1);
       }  else if(cComp==4){
           JOptionPane.showMessageDialog(rootPane, "Παρακαλώ επιλέξτε φύλο καλλιτέχνη","Σφάλμα",1);
       }  else if(cComp==5){
         JOptionPane.showMessageDialog(rootPane, "Παρακαλώ επιλέξτε είδος μουσικής","Σφάλμα",1);  
       }else if(cComp==6){
         JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται τόπο γέννησης","Σφάλμα",1);  
       }else if(cComp==7){
         JOptionPane.showMessageDialog(rootPane, "Παρακαλώ εισάγεται ημερομηνία γέννησης","Σφάλμα",1);  
       } else {
           
           String NewjTextArtistId=jTextArtistId.getText();
           String NewjTextArtistLastName=jTextArtistLastName.getText();
           String NewjTextArtistName=jTextArtistName.getText();
           String NewjTextArtisticName=jTextArtisticName.getText();
           String NewsexComboBox=(String)sexComboBox.getSelectedItem();
           /*MG=radiostation.AppControl.getByName(genreComboBox.getSelectedItem().toString());*/
           String NewjTextBirthPlace=jTextBirthPlace.getText();
           Date NewReleaseDt=ReleaseDt.getDate();
           /*art = new Artist
        (0, NewjTextArtistId, NewjTextArtistLastName, NewjTextArtistName, 
                NewjTextArtisticName, NewsexComboBox, MG, NewjTextBirthPlace, NewReleaseDt);*/
           
       /*if(radiostation.AppControl.SaveArtist(art)){
           
           JOptionPane.showMessageDialog(null,"Artist Saved","ERROR",JOptionPane.ERROR_MESSAGE );
       }
       else{
           JOptionPane.showMessageDialog(null, "Σφάλμα επικοινωνίας με τη ΒΔ!","ERROR",JOptionPane.ERROR_MESSAGE);
       }*/
dispose();       
       
       
       }
                
           
     } 
     else if(!creator.createMode&&!creator.deleteMode&&creator.editMode){
         
        
         
         
         
         
         
     }
    else if(!creator.createMode&&!creator.deleteMode&&creator.editMode){
        
        
        
        
    }
     
    
    
    }
    
    int checkComponents(){
        if(this.jTextArtistId.getText().isEmpty()){
          return(0);  
        }
          if(this.jTextArtistLastName.getText().isEmpty()) {
              return(1);
          }    
            if(this.jTextArtistName.getText().isEmpty()) {
                return(2);
            }
              if(this.jTextArtisticName.getText().isEmpty()) {
                  return(3);
              }
                if(this.sexComboBox.getSelectedIndex()==0) {
                    return(4);
                }
                  if(this.genreComboBox.getSelectedIndex()==0) {
                      return(5);
                  }
                    if(this.jTextBirthPlace.getText().isEmpty()) {
                        return(6);
                    }
                      if(this.ReleaseDt.getDate()==null) {
                          return(7);
                      }
                      
                      else{
                          return(7);
                      }
    }
        /*R2_ArtistList_View createMode = new R2_ArtistList_View();
          R2_ArtistList_View editMode = new R2_ArtistList_View(); 
           R2_ArtistList_View deleteMode = new R2_ArtistList_View();
           
           if (createMode.getCreateMode()==true){
               Artist art= new Artist();
               //art.setArtistId(this.jTextArtistId.getText());
              art.setFirstName(this.jTextArtistName.getText());
              art.setLastName(this.jTextArtistLastName.getText()); 
              art.setArtisticName(this.jTextArtisticName.getText()); 
              art.setBirthPlace(this.jTextBirthPlace.getText()); 
              art.setSex(sexComboBox.getSelectedItem().toString());
              
              
           }
           else if(editMode.getEditMode()==true){
               String sql="update from ARTIST where ArtistId=?";
               try{
                   pst=conn.prepareStatement(sql);
                   pst.setString(1,jTextArtistId.getText());
                   pst.setString(2,jTextArtistName.getText());
                   pst.setString(3,jTextArtistLastName.getText());
                   pst.setString(4,jTextBirthPlace.getText());
                   pst.setString(5,sexComboBox.getSelectedItem().toString());
                    
               }catch(Exception e){
                   JOptionPane.showMessageDialog(null, e);
               }
               
               
           }
           else if(deleteMode.getDeleteMode()==true){
               
               String sql="delete from ARTIST where ArtistId=?";
               try{
                   pst=conn.prepareStatement(sql);
                   pst.setString(1,jTextArtistId.getText());
                   pst.execute();
                   
                   JOptionPane.showMessageDialog(null, "Ο καλλιτέχνης διαγράφηκε με επιτυχία");
               }catch(Exception e){
                   
                   JOptionPane.showMessageDialog(null, e);
               }
               
           }
           dispose();
// TODO add your handling code here:
    }//GEN-LAST:event_jButSaveActionPerformed
*/
    private void jTextArtistLastNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextArtistLastNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextArtistLastNameActionPerformed

    private void jTextArtisticNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextArtisticNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextArtisticNameActionPerformed

    private void jTextBirthPlaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextBirthPlaceActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextBirthPlaceActionPerformed

    private void genreComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genreComboBoxActionPerformed
        // TODO add your handling code here:
       
    }//GEN-LAST:event_genreComboBoxActionPerformed

    private void sexComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sexComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_sexComboBoxActionPerformed

    private void jTextArtistNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextArtistNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextArtistNameActionPerformed
    
    /*
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(R3_Artist_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(R3_Artist_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(R3_Artist_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(R3_Artist_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

         /*Create and display the form*/
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new R3_Artist_Management().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.persistence.EntityManager RadioStationPUEntityManager;
    private org.jdesktop.swingx.JXDatePicker ReleaseDt;
    private javax.swing.JButton btnCancel;
    private javax.swing.JComboBox genreComboBox;
    private javax.swing.JButton jButSave;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField jTextArtistId;
    private javax.swing.JTextField jTextArtistLastName;
    private javax.swing.JTextField jTextArtistName;
    private javax.swing.JTextField jTextArtisticName;
    private javax.swing.JTextField jTextBirthPlace;
    private java.util.List<radiostation_POJO.Musicgenre> musicgenreList;
    private javax.persistence.Query musicgenreQuery;
    private javax.swing.JComboBox sexComboBox;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
